import { Button, Card, Checkbox, Form, message, Modal, Radio, Row, Col, Select, Input, InputNumber, DatePicker,} from "antd";
import DescriptionList from '@/components/DescriptionList';
import { connect } from "dva";
import React, { PureComponent } from "react";
import { transferOption } from "@/utils/common";
import { getDicByKey } from '@/support/common';
import moment from 'moment';
import PropTypes from 'prop-types';
import MaskText from "@/components/MaskText";

const FormItem = Form.Item;
const { Description } = DescriptionList;

@connect(({  }) => ({
  
}))
export default class dealDetailModal extends PureComponent {
  static contextTypes = {
    dicData: PropTypes.any,
  };
  state = {
    buttonLoading: false,
  };

  componentDidMount() {
  }

  setLoading = (flag) => {
    this.setState({
      buttonLoading: flag,
    });
  };

  close = () => {
    const { form, changeVisible } = this.props
    changeVisible()
  };
 
  renderSimpleForm() {
    const { modalVisible, detailModelData} = this.props;
    const { buttonLoading,} = this.state;
    const status = ['', '考察', 'MOU', '保证金', '建设', '开业准备', '开业', '撤销'];
    const type = ['4S', '4SA', '城市展厅'];
    const footer = (
      <div>
        <Button onClick={this.close}>关闭</Button>
      </div>
    );
    return (
      <Modal
        footer={footer}
        title="经销商详情"
        visible={modalVisible}
        onCancel={this.close}
      >
       <div>
          <Card bordered={false}>
            <DescriptionList col={2}>
              <Description term="经销商名称">{detailModelData.name}</Description>
              <Description term="经销商简称">{detailModelData.shortName}</Description>
              <Description term="经销商编码">{detailModelData.code}</Description>
              <Description term="大区">{detailModelData.areaName}</Description>
              <Description term="小区">{detailModelData.smallAreaName}</Description>
              <Description term="省">{detailModelData.provinceName}</Description>
              <Description term="市">{detailModelData.cityName}</Description>
              <Description term="地址">
                <MaskText text={detailModelData.address} type="location" />
              </Description>
              <Description term="邮政编码">{detailModelData.zipCode}</Description>
              <Description term="邮箱">
                <MaskText text={detailModelData.email} type="email" />
              </Description>
              <Description term="联系电话"style={{ width: '100%' }}>
                <MaskText text={detailModelData.phone} type='phone' />
              </Description>
              <Description term="传真">
                <MaskText text={detailModelData.fax} type="fax" />
              </Description>
              <Description term="经度"style={{ width: '50%' }}>
                <MaskText text={detailModelData.lon} type="longitude" />
              </Description>
              <Description term="纬度"style={{ width: '50%' }}>
                <MaskText text={detailModelData.lat} type="latitude" />
              </Description>
              <Description term="合作类型">{type[detailModelData.type]}</Description>
              <Description term="上级门店编码">{detailModelData.parentCode}</Description>
              <Description term="责任人姓名">
                <MaskText text={detailModelData.salesManagerName} type="name" />
              </Description>
              <Description term="责任人电话">
                <MaskText text={detailModelData.salesManagerCall} type="phone" />
              </Description>
              <Description term="责任人职务">{detailModelData.salesManagerPosition}</Description>
              <Description term="创建日期">{moment(detailModelData.createDate).format('YYYY-MM-DD')}</Description>
            </DescriptionList>
          </Card>
        </div>
      </Modal>
    );
  }

  render() {
    return this.renderSimpleForm();
  }
}
